#ifndef _LPC_CONFIG_H
#define _LPC_CONFIG_H

#include <string.h>
#include "lpc24xx.h"
#include "lpc_types.h"
#include "timer/timer.h"

#define SDRAM_BASE_ADDR *(volatile unsigned int*)0xA0000000
#define LCD_VRAM_BASE_ADDR ((UNS_32)&SDRAM_BASE_ADDR)
#define LCD_CURSOR_BASE_ADDR ((UNS_32)0xFFE10800)

#define XTAL_CLOCK 			11059200
#define CPU_CLOCK_HZ        ( ( unsigned int ) XTAL_CLOCK * 4 )	/* =11.0592Mhz xtal multiplied by 4 using the PLL. */
#define COLORS_DEF 	16      /* 16-bit 565 color mode */

/* PLL parameters */
#define PLL_MUL					( ( unsigned int ) ( 8 - 1 ) )
#define PLL_DIV					( ( unsigned int ) 0x0000 )
#define CPU_CLK_DIV				( ( unsigned int ) 0x0003 )
#define PLL_ENABLE				( ( unsigned int ) 0x0001 )
#define PLL_CONNECT				( ( ( unsigned int ) 0x0002 ) | PLL_ENABLE )
#define PLL_FEED_BYTE1			( ( unsigned int ) 0xaa )
#define PLL_FEED_BYTE2			( ( unsigned int ) 0x55 )
#define PLL_LOCK				( ( unsigned int ) 0x4000000 )
#define PLL_CONNECTED			( ( unsigned int ) 0x2000000 )
#define OSC_ENABLE				( ( unsigned int ) 0x20 )
#define OSC_STAT				( ( unsigned int ) 0x40 )
#define OSC_SELECT				( ( unsigned int ) 0x01 )

/* Constants to setup the MAM. */
#define mainMAM_TIM_3				( ( unsigned char ) 0x03 )
#define mainMAM_MODE_FULL			( ( unsigned char ) 0x02 )

#endif
